var sql = require('../api/connect');
var login=function(req,res){
	sql.query('select name from user where name="'+ req.body.username+'" and password="'+req.body.password+'"',function(err,rows){
		console.log(rows)
    if (err || rows.length == 0) {
      console.log(err)
       res.send({code: 400,ms: '账号密码错误'})
    }else {
      res.send({code: 200,user:req.body.username})
    }
	})
}
module.exports=login;
